package com.ckf.es.document;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Mapping;

import java.io.Serializable;
import java.util.Date;

/**
 * 产品实体
 * @author zhoudong
 * @version 0.1
 * @date 2018/12/13 15:22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "orders", type = "product")  //创建索引库orders
@Mapping(mappingPath = "productIndex.json")        // 解决IK分词不能使用问题
public class ProductDocument implements Serializable {

    @Id
    private String id;

    //@Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String productName;

    //@Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String productDesc;

    private Date createTime;

    private Date updateTime;

}
